/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package remind;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author Yevheniy Semenov
 */
public class Note {
    private Date dateTime;
    private String name;
    private int priority;
    private String text;
    public boolean isActual;
    private int MAX_PRIORITY = 5;
    private int MIN_PRIORITY = 1;
    private  int ID;
    
    
    public String dateToStr(Date date)
    {
        DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        return dateFormat.format(date);
    }
    
    public Date strToDate(String date) throws ParseException
    {
        DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        return dateFormat.parse(date);
    }
    
    public void Note()
    {
        dateTime = CurrentDate();
        name = "NewNote";
        text = "";
        isActual = true;
        priority = MAX_PRIORITY;
    }
    
    private Date CurrentDate()
    {
        Date date = new Date();
        return date;
    }
    
    public void setDate(Date newDate)
    {
        dateTime = newDate;
    }
    
    public Date getDate()
    {
        return dateTime;
    }
    
    public void setName(String newName)
    {
        name = newName;
    }
    
    public String getName()
    {
        return name;
    }
    
    public void setText(String newText)
    {
        text = newText;
    }
    
    public String getText()
    {
        return text;
    }
    
    public void setPriority(int newPriority)
    {
        priority = newPriority>MAX_PRIORITY ? MAX_PRIORITY : 
                newPriority < MIN_PRIORITY ? MIN_PRIORITY : newPriority;
    }
    
    public int getPriority()
    {
        return priority;
    }
    
    public void setActuality(boolean newActuality)
    {
        isActual = newActuality;
    }
    
    public boolean getActuality()
    {
        return isActual;
    }
    
    public void setID(int inp){
    ID=inp;
    }
    
    public int getID(){
    return ID;
    }
        
}
